FROM php:8.2-fpm


RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo 'Asia/Shanghai' >/etc/timezone \
    && echo 'date.timezone=PRC' > /usr/local/etc/php/conf.d/timezone.ini

MAINTAINER wchuang <wchuang@aliyun.com>

# Libs
RUN apt-get update
RUN apt-get install -y \
        curl \
        wget \
        git \
        zip \
        vim \
        libz-dev \
        libssl-dev \
        libnghttp2-dev \
        libpcre3-dev \
        procps \
        htop
#    && apt-get clean \
#    && apt-get autoremove

RUN curl -sS https://getcomposer.org/installer | php \
    && mv composer.phar /usr/local/bin/composer \
    && composer self-update --clean-backups


# Bcmath extension
RUN docker-php-ext-install bcmath

#ADD . /var/www/html

WORKDIR /var/www/html

#RUN composer install --no-dev \
#    && composer dump-autoload -o

EXPOSE 8080

CMD ["php-fpm"]
